package com.starblink.login.deletionconfirm.ui

import androidx.lifecycle.viewModelScope
import com.starblink.android.basic.base.BaseViewModel
import com.starblink.android.basic.network.base.SkGqlClient
import com.starblink.rocketreserver.RemoveAccountMutation
import kotlinx.coroutines.launch


class DeletionConfirmVM : BaseViewModel() {

//        var mList: MutableLiveData<ArrayList<Any>> = MutableLiveData()

    inline fun deleteAccount(crossinline showConfirmDialog: () -> Unit) {
        viewModelScope.launch {
            val response = SkGqlClient.skMutation(
                RemoveAccountMutation(),
                showDefaultLoading = true
            )
            if (response?.data != null && response.data!!.removeAccount) {
                showConfirmDialog()
            }

        }

    }

}